package com.lengyue.imakiba.show;

import java.util.List;


import com.jfinal.core.Controller;
import com.lengyue.imakiba.data.Anime;
import com.lengyue.imakiba.data.AnimeInterface;
import com.lengyue.imakiba.data.Type;
import com.lengyue.imakiba.logic.AnimeLogic;
import com.lengyue.imakiba.logic.TypeLogic;

public class Index extends Controller implements AnimeInterface {
	public void index()
	{
		//导航栏动漫类型
		List<Type> types = TypeLogic.getAllTypesAndSort();
		//连载动漫
		//List<Anime> serializeAnimes = getAnimeByState("serialize", 15);
		//最新动漫.
		List<Anime> recentAnimes = AnimeLogic.getAnimeByState(1,15,null).getList();
		//完结动漫
		List<Anime> endAnimes = AnimeLogic.getAnimeByState(1,15,"end").getList();
		//动漫预告
		List<Anime> pvAnimes = AnimeLogic.getAnimeByState(1,15,"pv").getList();
		setAttr("types", types);
		//setAttr("serializeAnimes",serializeAnimes);
		setAttr("recentAnimes",recentAnimes);
		setAttr("endAnimes",endAnimes);
		setAttr("pvAnimes",pvAnimes);
		setAttr("coverPath", coverPath);
		render("/WEB-INF/freeMarkerTemplete/index.ftl");
	}
}
